﻿using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;

namespace AimGameEngine.NodeEditorObject
{
    partial class PropretyVideoPlayer : Form
    {
        NodeVideoPlayer nodevedioplayer;
        public PropretyVideoPlayer(NodeVideoPlayer nodevedioplayer)
        {
            InitializeComponent();
            this.nodevedioplayer = nodevedioplayer;
            this.PathTexture.Text = nodevedioplayer.MyData.Data;
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            nodevedioplayer.MyData.Data = this.PathTexture.Text;
        }

        private void Browse_Click(object sender, EventArgs e)
        {
            OpenFileDialog file = new OpenFileDialog();
            // Default to the directory which contains our content files.
            string assemblyLocation = Assembly.GetExecutingAssembly().Location;
            string relativePath = Path.Combine(assemblyLocation, "../../../../Content");
            string contentPath = Path.GetFullPath(relativePath);

            file.InitialDirectory = contentPath;

            file.Title = "Browse Texture2D";
            // XNA support .wmv
            file.Filter = "Windows Media Video (*.wmv)|*.wmv";

            file.FilterIndex = 1;

            if (file.ShowDialog() == DialogResult.OK)
            {
                this.PathTexture.Text = file.FileName;
            }
        }
    }
}
